<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>挂卖大厅</title>
	<script src="/static/mobile/js/mui.min.js"></script>
	<link href="/static/mobile/css/mui.min.css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/basic.css"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/active_huiyuan.css"/>
	<script type="text/javascript" src="/static/mobile/js/jquery.js"></script>
	<script type="text/javascript" charset="utf-8">
        mui.init();
	</script>
</head>
<body>
<div class="sectionx">
	<header class="mui-bar mui-bar-nav" >
		<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back(-1)" style="color: #4E4E4E;"></a>
		<h1 class="mui-title">挂卖大厅</h1>
	</header>
</div>
<div class="section3">
</div>
<div class="ge"></div>

<div class="section4">
	<div class="layui-form">
		<div class="section4-1">
			<ul>
				<li style='width:20%'>会员编号</li>
				<li style='width:20%'>数量</li>
				<li style='width:15%'>价格</li>
				<li style='width:25%'>时间</li>
				<li style='width:20%'>操作</li>
			</ul>
		</div>
		<div class="section4-2 mui-clearfix">
			{volist name='lists' id='vo'}
			<ul >
				<li style='width:20%' >{$vo.unickname}</li>
				<li style='width:20%'> {$vo.num}</li>
				<li style='width:15%'>{$vo.price}</li>
				<li style='width:25%'>{$vo.createtime|date='Y-m-d H:i:s'}</li>
				<li style='width:20%'>
					<button  class="layui-btn" onclick="return commints('{$vo.id}');"  style="padding: 4px 12px;color: #fff;background: red;border-color: red" >购买</button>
				</li>
			</ul>
			{/volist}

		</div>
	</div>
</div>

{$page|raw}

</body>
<script type="text/javascript" >
    mui('body').on( 'tap' , 'a' , function(){
        document.location.href=this.href;
    })
</script>
<script src="/static/plugins/layui/layui.js"></script>
<script>
    function commints(id){
        $.ajax({
            type : "POST",  //请求方式
            async:false,
            url : "{:url('guamai')}",  //请求路径
            dataType:"html",
            data :'id='+id,
            beforeSend:function()
            {   //触发ajax请求开始时执行
                $('.newbtn'+id).text('提交中...');
                $('.newbtn'+id).attr('onclick','javascript:void(0);');//改变提交按钮上的文字并将按钮设置为不可点击
            },
            success : function(msg) {  //异步请求成功执行的回调函数
                var jsonParseJson=JSON.parse(msg);
                if(jsonParseJson['success']==1){
                    layer.msg(jsonParseJson['msg'],{time:1000,icon:1},function(){
                        location.href = "{:url('index')}";
                    });
                }else{
                /*    $('.newbtn'+id).text('打款');*/
                    layer.msg(jsonParseJson['msg'],{time:1000,icon:2});
                }

            }
        });
    }
    layui.use(['form', 'layer'], function () {

    })
</script>


</html>